<!DOCTYPE html>
<html lang="zh-CN">
<head>
  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  <title>web 服务构建 - swagger(rest) - 服务计算 - 中山大学</title>
  <meta name="renderer" content="webkit" />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"/>

<meta http-equiv="Cache-Control" content="no-transform" />
<meta http-equiv="Cache-Control" content="no-siteapp" />

<meta name="theme-color" content="#f8f5ec" />
<meta name="msapplication-navbutton-color" content="#f8f5ec">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="#f8f5ec">


<meta name="author" content="潘茂林" /><meta name="description" content="Golang web 服务构建 - Swagger(REST) https://www.helplib.com/GitHub/article_122113 1 $ go get -u github.com/go-swagger/go-swagger/cmd/swagger OpenAPI 规格说明 由于 swagger 官方已 OpenAPI 已升级到 3.0。 但许多案例依然是 2.0，请到以下地址查看 2.0 版本语法与语义。 swagger 2.0 版本 https://swagger.io/specification/v2/" /><meta name="keywords" content="中山大学, 数据科学与计算机, 服务计算" />






<meta name="generator" content="Hugo 0.74.3 with theme even" />


<link rel="canonical" href="http://pmlpml.git.io/service-computing/post/services-rest/" />
<link rel="apple-touch-icon" sizes="180x180" href="/service-computing/apple-touch-icon.png">
<link rel="icon" type="image/png" sizes="32x32" href="/service-computing/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="16x16" href="/service-computing/favicon-16x16.png">
<link rel="manifest" href="/service-computing/manifest.json">
<link rel="mask-icon" href="/service-computing/safari-pinned-tab.svg" color="#5bbad5">



<link href="/service-computing/sass/main.min.8c3cbcb0324c2bb4875ceccba4007cbad4b4ac8377f33af9953c3e7684534a50.css" rel="stylesheet">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fancyapps/fancybox@3.1.20/dist/jquery.fancybox.min.css" integrity="sha256-7TyXnr2YU040zfSP+rEcz29ggW4j56/ujTPwjMzyqFY=" crossorigin="anonymous">


<meta property="og:title" content="web 服务构建 - swagger(rest)" />
<meta property="og:description" content="Golang web 服务构建 - Swagger(REST) https://www.helplib.com/GitHub/article_122113 1 $ go get -u github.com/go-swagger/go-swagger/cmd/swagger OpenAPI 规格说明 由于 swagger 官方已 OpenAPI 已升级到 3.0。 但许多案例依然是 2.0，请到以下地址查看 2.0 版本语法与语义。 swagger 2.0 版本 https://swagger.io/specification/v2/" />
<meta property="og:type" content="article" />
<meta property="og:url" content="http://pmlpml.git.io/service-computing/post/services-rest/" />

<meta itemprop="name" content="web 服务构建 - swagger(rest)">
<meta itemprop="description" content="Golang web 服务构建 - Swagger(REST) https://www.helplib.com/GitHub/article_122113 1 $ go get -u github.com/go-swagger/go-swagger/cmd/swagger OpenAPI 规格说明 由于 swagger 官方已 OpenAPI 已升级到 3.0。 但许多案例依然是 2.0，请到以下地址查看 2.0 版本语法与语义。 swagger 2.0 版本 https://swagger.io/specification/v2/">

<meta itemprop="wordCount" content="69">



<meta itemprop="keywords" content="" />
<meta name="twitter:card" content="summary"/>
<meta name="twitter:title" content="web 服务构建 - swagger(rest)"/>
<meta name="twitter:description" content="Golang web 服务构建 - Swagger(REST) https://www.helplib.com/GitHub/article_122113 1 $ go get -u github.com/go-swagger/go-swagger/cmd/swagger OpenAPI 规格说明 由于 swagger 官方已 OpenAPI 已升级到 3.0。 但许多案例依然是 2.0，请到以下地址查看 2.0 版本语法与语义。 swagger 2.0 版本 https://swagger.io/specification/v2/"/>

<!--[if lte IE 9]>
  <script src="https://cdnjs.cloudflare.com/ajax/libs/classlist/1.1.20170427/classList.min.js"></script>
<![endif]-->

<!--[if lt IE 9]>
  <script src="https://cdn.jsdelivr.net/npm/html5shiv@3.7.3/dist/html5shiv.min.js"></script>
  <script src="https://cdn.jsdelivr.net/npm/respond.js@1.4.2/dest/respond.min.js"></script>
<![endif]-->

</head>
<body>
  <div id="mobile-navbar" class="mobile-navbar">
  <div class="mobile-header-logo">
    <a href="/service-computing/" class="logo">服务计算</a>
  </div>
  <div class="mobile-navbar-icon">
    <span></span>
    <span></span>
    <span></span>
  </div>
</div>
<nav id="mobile-menu" class="mobile-menu slideout-menu">
  <ul class="mobile-menu-list">
    <a href="/service-computing/post/index-2020">
        <li class="mobile-menu-item">首页</li>
      </a><a href="/service-computing/post/">
        <li class="mobile-menu-item">归档</li>
      </a><a href="/service-computing/tags/">
        <li class="mobile-menu-item">标签</li>
      </a><a href="/service-computing/about/">
        <li class="mobile-menu-item">关于</li>
      </a>
  </ul>
</nav>
  <div class="container" id="mobile-panel">
    <header id="header" class="header">
        <div class="logo-wrapper">
  <a href="/service-computing/" class="logo">服务计算</a>
</div>

<nav class="site-navbar">
  <ul id="menu" class="menu">
    <li class="menu-item">
        <a class="menu-item-link" href="/service-computing/post/index-2020">首页</a>
      </li><li class="menu-item">
        <a class="menu-item-link" href="/service-computing/post/">归档</a>
      </li><li class="menu-item">
        <a class="menu-item-link" href="/service-computing/tags/">标签</a>
      </li><li class="menu-item">
        <a class="menu-item-link" href="/service-computing/about/">关于</a>
      </li>
  </ul>
</nav>
    </header>

    <main id="main" class="main">
      <div class="content-wrapper">
        <div id="content" class="content">
          <article class="post">
    
    <header class="post-header">
      <h1 class="post-title">web 服务构建 - swagger(rest)</h1>

      <div class="post-meta">
        <span class="post-time"> 0001-01-01 </span>
        
        
      </div>
    </header>

    <div class="post-toc" id="post-toc">
  <h2 class="post-toc-title"></h2>
  <div class="post-toc-content always-active">
    <nav id="TableOfContents">
  <ul>
    <li><a href="#golang-web-服务构建---swaggerrest">Golang web 服务构建 - Swagger(REST)</a>
      <ul>
        <li><a href="#openapi-规格说明">OpenAPI 规格说明</a></li>
      </ul>
    </li>
  </ul>
</nav>
  </div>
</div>
    <div class="post-content">
      <h1 id="golang-web-服务构建---swaggerrest">Golang web 服务构建 - Swagger(REST)</h1>
<p><a href="https://www.helplib.com/GitHub/article_122113">https://www.helplib.com/GitHub/article_122113</a></p>
<div class="highlight"><div class="chroma">
<table class="lntable"><tr><td class="lntd">
<pre class="chroma"><code><span class="lnt">1
</span></code></pre></td>
<td class="lntd">
<pre class="chroma"><code class="language-fallback" data-lang="fallback">$ go get -u github.com/go-swagger/go-swagger/cmd/swagger
</code></pre></td></tr></table>
</div>
</div><h2 id="openapi-规格说明">OpenAPI 规格说明</h2>
<p>由于 swagger 官方已 OpenAPI 已升级到 3.0。 但许多案例依然是 2.0，请到以下地址查看 2.0 版本语法与语义。</p>
<p>swagger 2.0 版本 <a href="https://swagger.io/specification/v2/">https://swagger.io/specification/v2/</a></p>

    </div>

    <div class="post-copyright">
  <p class="copyright-item">
    <span class="item-title"></span>
    <span class="item-content">潘茂林</span>
  </p>
  <p class="copyright-item">
    <span class="item-title"></span>
    <span class="item-content">
        0001-01-01
        
    </span>
  </p>
  
  
</div>
<footer class="post-footer">
      
      <nav class="post-nav">
        <a class="prev" href="/service-computing/post/services-grpc/">
            <i class="iconfont icon-left"></i>
            <span class="prev-text nav-default">web 服务构建 - gRPC</span>
            <span class="prev-text nav-mobile"></span>
          </a>
        <a class="next" href="/service-computing/post/ex-install-cloud/">
            <span class="next-text nav-default">私有云</span>
            <span class="next-text nav-mobile"></span>
            <i class="iconfont icon-right"></i>
          </a>
      </nav>
    </footer>
  </article>
        </div>
        

  

  

      </div>
    </main>

    <footer id="footer" class="footer">
      <div class="social-links">
      <a href="mailto:panml@mail.sysu.edu.cn" class="iconfont icon-email" title="email"></a>
  <a href="http://pmlpml.git.io/service-computing/index.xml" type="application/rss+xml" class="iconfont icon-rss" title="rss"></a>
</div>

<div class="copyright">
  <span class="power-by">
    %!(EXTRA string=<a class="hexo-link" href="https://gohugo.io">Hugo</a>)
  </span>
  <span class="division">|</span>
  <span class="theme-info">
     - 
    <a class="theme-link" href="https://github.com/olOwOlo/hugo-theme-even">Even</a>
  </span>

  

  <span class="copyright-year">
    &copy; 
    2018 - 
    2020
    <span class="heart">
      <i class="iconfont icon-heart"></i>
    </span>
    <span class="author">潘茂林</span>
  </span>
</div>
    </footer>

    <div class="back-to-top" id="back-to-top">
      <i class="iconfont icon-up"></i>
    </div>
  </div>
  
  <script src="https://cdn.jsdelivr.net/npm/jquery@3.2.1/dist/jquery.min.js" integrity="sha256-hwg4gsxgFZhOsEEamdOYGBf13FyQuiTwlAQgxVSNgt4=" crossorigin="anonymous"></script>
  <script src="https://cdn.jsdelivr.net/npm/slideout@1.0.1/dist/slideout.min.js" integrity="sha256-t+zJ/g8/KXIJMjSVQdnibt4dlaDxc9zXr/9oNPeWqdg=" crossorigin="anonymous"></script>
  <script src="https://cdn.jsdelivr.net/npm/@fancyapps/fancybox@3.1.20/dist/jquery.fancybox.min.js" integrity="sha256-XVLffZaxoWfGUEbdzuLi7pwaUJv1cecsQJQqGLe7axY=" crossorigin="anonymous"></script>



<script type="text/javascript" src="/service-computing/js/main.min.d7b7ada643c9c1a983026e177f141f7363b4640d619caf01d8831a6718cd44ea.js"></script>








</body>
</html>
